measure_time
The crate provides macros, which measure the time until end of scope.
This is done by creating an object, which measures the time. The time is printed when the object is dropped.
The logging behaviour is the same as other log macros like info!(..)
Installation
Simply add a corresponding entry to your Cargo.toml
dependency list:
[]
= "0.7"
Examples
use ;
Changelog
Version 0.4
Objects to measure time are only created when the log level is enabled, else None
will be created
Version 0.4.2
Add error and warn levels
Version 0.5.0
Change time formatting for improved readability
Version 0.6.0
Behaviour is now the same as other log macros (eg. info!). Reexporting log crate macros via pub use. Previously all tracing was made to the measure_time target (e.g. RUST_LOG=measure_time=debug). This is now fixed. Added a small example (https://github.com/PSeitz/rust_measure_time/tree/master/measure_time_example).
Version 0.7.0
Support 2018 imports, with improved macro import hygiene.